package com.chao.tlias.controller;
/**
 * 数据报表控制类
 */

import com.chao.tlias.Pojo.JobOption;
import com.chao.tlias.Pojo.Result;
import com.chao.tlias.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/report")
@Slf4j
public class ReportController {

    @Autowired
    private ReportService reportService;

    /**
     * 获取员工岗位报表数据
     */
    @GetMapping("/empJobData")
    public Result GetEmpJobData(){
        log.info("获取员工岗位报表数据");
        JobOption jobOption = reportService.geEmpJobData();
        return Result.success(jobOption);
    }

    @GetMapping("/empGenderData")
    public Result GetEmpGenderData(){
        log.info("统计员工性别信息");
        List<Map<String, Object>> genderData = reportService.GetEmpGenderData();
        return Result.success(genderData);
    }
}
